﻿namespace PerfectNumber
{
    internal class Program
    {
        static void Main(string[] args)
        {
            for (int num = 2; num <= 1000; num++)
            {
                int sum = 1;
                for (int i = 2; i <= num / 2; i++)
                {
                    if (num % i == 0)
                    {
                        sum += i;
                    }
                }
                if (sum == num)
                {
                    Console.WriteLine(num);
                }
            }
            Console.ReadLine();
        }
    }
}